<style>
.weui_cell_bd {
    padding: 0;
	min-height:1.6rem;
	line-height:1.6rem;
}
.weui_cell_hd {min-width:3.7rem;padding: 0 4px;}
.weui_input {padding:0}
</style>
<style>
.fui-goods-item .image {
    height: 7rem;
    width: 10rem;
}
.fui-goods-group {
    padding:0.3rem
}
.timer {
    font-size: .6rem;
    height: .95rem;
    color: #ef4f4f;
}
.timer span {
    display: inline-block;
    background:#582e19;
    color:#fff;
    width:.9rem;height:.9rem;
    border-radius: .1rem;
    line-height:.9rem;
    font-size:.5rem; text-align: center;
}
.radius .jy-group {border-radius:0.5rem;margin:0.35rem 0.5rem}
.radius .jy-group .fui-cell-group{border-radius:0.5rem;margin-top:0}
.bgfff .jy-group {background: #fff}
</style>
<div class='fui-page fui-page-current page-commission-register'>
	<img style="width:100%;position: relative" ng-src="{{tomedia(pagedata.applyset.regbg) || '../addons/jy_weishop/resource/images/agent-top.jpg'}}" />
	<div ng-if="pagedata.member.stop==1" class='fui-content'>
        <div  class='content-empty' >
            <i class='icon icon-info text-danger'></i>
            <br/><span class="text-danger">禁止访问，请联系客服！</span>
        </div>
	</div>
	<div ng-if="pagedata.member.stop !=1">
	<div class='fui-content radius' ng-if="!pagedata.apply && !pagedata.can_apply">
			<div  class='fui-list-group'>
				<div class='fui-list-group-title'><i class="icon icon-lights"></i> 友情提醒</div>
				<div class='fui-list' ng-if="!pagedata.pluginset.agent_desc">
					<div ng-if="pagedata.pluginset.become!=3" class='fui-list-inner'>
						<div class='text'>{{pagedata.desc}} ，
							才可成为&lt;<span class="text-danger text-bold">{{pagedata.setting.tagent || '股东'}}</span>&gt;</div>
					</div>
					<div ng-if="pagedata.pluginset.become==3 && pagedata.pluginset.team_tiaojian!=12" class='fui-list-inner'>
						<div class='text'>{{pagedata.team_tiaojians[pagedata.pluginset.team_tiaojian]}}<span class="text-danger text-bold">{{pagedata.limit}}</span>{{pagedata.unit}}，
							才可成为&lt;<span class="text-danger text-bold">{{pagedata.setting.tagent || '股东'}}</span>&gt;，您已达 <span class="text-danger text-bold">{{pagedata.now}}</span> {{pagedata.unit}}，请继续努力！</div>
					</div>
					<div ng-if="pagedata.pluginset.become==3 && pagedata.pluginset.team_tiaojian==12" class='fui-list-inner'>
						<div class='text'>购买下面指定商品，
							才可成为<span class="text-danger text-bold">【{{pagedata.setting.tagent || '股东'}}】</span>！</div>
					</div>
				</div>
				<div class='fui-list' ng-if="pagedata.pluginset.agent_desc">
					<div class='fui-list-inner'>
						<div class='text'>{{pagedata.pluginset.agent_desc}}</div>
					</div>
				</div>
			</div>
			<a ng-if="pagedata.pluginset.team_tiaojian!=12" class="btn btn-danger block" href="javascript:;" ng-click="access_json(pagedata.indexurl)">继续去购物</a>
			<div ng-if="pagedata.become_goods.length>0" class="jy-group">
			<div class="fui-goods-group no {{item.total <=0?'disabled':''}}" style="padding:0;background-color:#f7f7f7">
				<div ng-repeat="item in pagedata.become_goods" class="fui-goods-item" style="padding:0;margin:0.2rem 0;border: 0px solid #e7e7e7;">
					<div ng-click="access_json(pagedata.indexurl);" ng-if="!item.video || pagedata.shopset.no_video==1" ng-class="{'image':1, 'echelon':item.active.title}" data-text="{{item.active.title}}" style="background-image: url({{tomedia(item.image) ||'../core/resource/images/nopic.jpg'}})">
							<div ng-show="item.total <=0" class="salez" style="background-image: url({{tomedia(pagedata.shopset.shop.saleout)}}); "></div>
					</div>
					<div ng-if="item.video && pagedata.shopset.no_video !=1" class="image">
						<video style="width:100%;height:100%;background:#999" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"
							  poster="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}"
							  data-setup='{"controls": true, "autoplay": false}'>
							  <source ng-src="{{tomedia(item.video)}}" type="video/mp4">					 
						</video>
					</div>
					<div class="detail" style="height:2.6rem;padding-left:0.3rem;padding-top:0.2rem">
						<div ng-click="access_json(pagedata.indexurl);" class="overflow-h" style="width:10rem">
								{{item.title}}
						</div>
						<div ng-if="!item.active.rest_time" class="subtitle overflow-h" style="width:10rem">
								{{item.subtitle || '暂时没有商品描述... ...'}}
						</div>
						<div ng-if="item.active.rest_time" class="timer" ng-init="tool.time_down(pagedata.list[$index].active.rest_time)" style="width:10rem">
								{{item.active.status==0?'距开始':'距结束'}}  <span class="time-hour">{{pagedata.list[$index].active.rest_time.hour}}</span>:<span class="time-min">{{pagedata.list[$index].active.rest_time.minute}}</span>:<span class="time-sec">{{pagedata.list[$index].active.rest_time.second}}</span>
						</div>
						<div>
							<div class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">{{item.merchname || '平台直营'}}</div>
							<div class="price red" style="margin-top:0.1rem">￥ 
								<span class="text">
									<span ng-if="!item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.price}}</span>
									<span ng-if="item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.active.price}}</span> /{{item.unit || '件'}}
									<span ng-if="!pagedata.pluginset.noweight && item.weight>0" style="color:#999;font-size:0.55rem;font-weight:400">({{item.weight}}kg)</span>
								</span>
								<span class="red" style="padding-right:0.5rem" href="javascript:" ng-click="access_json(pagedata.indexurl);"><i class="icon icon-tianmaochaoshigouwuche"></i></span>
							</div>
						</div>
						<div class="price" style="position:absolute;margin-top: 0.5rem;bottom:0.1rem;width:10rem">
							<span class="text">
								<span class="subtitle" style="font-weight:400;padding-left:0.2rem">已售{{item.salenum || 0}}{{item.unit || '件'}}</span>
							</span>
							<span class=" fui-buys-info r-f" style="width:6rem;padding-right:0.6rem">
									<img ng-repeat="m in item.members" ng-if="$index<6" class="avatar r-f" style="width:1.3rem;height:1.3rem;margin-right:-0.6rem" ng-src="{{tomedia(m.avatar) || '../core/resource/images/nopic.jpg'}}">
							</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div ng-if="!pagedata.applyagain && pagedata.apply" class='fui-content'>
		<div ng-if="pagedata.applystatus==0" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">谢谢您的支持，请等待审核！</span>
        </div>
		<div ng-if="pagedata.applystatus==1 && pagedata.member.is_agent!=1" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">您的{{pagedata.setting.agent_title||'代理'}}身份已经清空！无法再申请{{pagedata.setting.agent_title||'代理'}}！</span>
        </div>
		<div ng-if="pagedata.member.is_agent==1" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">恭喜您，您的{{pagedata.setting.agent_title||'代理'}}申请已审核通过！</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="access_json('jy_merch2fee/index/')">前往{{pagedata.setting.agent_title||'代理'}}中心</a>
        </div>
		<div ng-if="pagedata.member.is_agent==2 || pagedata.applystatus==2" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">非常抱歉，您的{{pagedata.setting.agent_title||'代理'}}申请被管理员拒绝！</span>
			<br/><span class="">未审核通过原因：</span>
			<br/><span class="subtitle">{{pagedata.apply.remark || '无'}}</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="pagedata.applyagain=1">重新申请</a>
        </div>
	</div>
    <div ng-if="(!pagedata.apply && pagedata.can_apply) || pagedata.applyagain" class='fui-content'>
        <div class="weui_cells weui_cells_form" style='margin-top:0'>
            <div class="fui-cell-title"style="padding:0.5rem 0.2rem">
                欢迎加入<span class='text-danger'>{{pagedata.applyset.shop_title || '股东平台'}}</span>，请填写申请信息
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd'>邀请人</div>
                <div class='weui_cell_bd weui_cell_primary overflow'><span class='text-danger'>{{pagedata.agent_name || '总店'}}</span> (请核对)</div>
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd'>邀请码</div>
                <div class='weui_cell_bd weui_cell_primary'><input type="text" class='weui_input' ng-model="pagedata.item.agent_id" placeholder="请填写邀请码" /></div>
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd must'>姓名</div>
                <div class='weui_cell_bd weui_cell_primary'><input type="text" class='weui_input' ng-model="pagedata.item.realname" placeholder="请填写真实姓名，用于结算" /></div>
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd must'>手机号</div>
                <div class='weui_cell_bd weui_cell_primary'><input type="tel" class='weui_input' ng-model="pagedata.item.mobile" placeholder="请填写手机号码方便联系" /></div>
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd'>微信号</div>
                <div class='weui_cell_bd weui_cell_primary'><input type="text" class='weui_input' ng-model="pagedata.item.wechat" placeholder="请填写微信号"  /></div>
            </div>
		</div>
		<div ng-if="pagedata.item.diyformfields.length>0" class="weui_cells_title">其他内容</div>
		<div class="weui_cells weui_cells_form" ng-repeat="item in pagedata.item.diyformfields">
									<div class="weui_cell"  ng-if="item.type == 1">
										<div ng-class="{'weui_cell_hd':1,'must':item.ismust==1}"><label class="weui_label">{{item.title}}</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
										</div>
									</div>	
									<div class="weui_cell" ng-if="item.type == 2">
										<div ng-class="{'weui_cell_hd':1,'must':item.ismust==1}"><label class="weui_label">{{item.title}}</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
										</div>
									</div>
									<div class="weui_cell" ng-if="item.type == 18">
									<div ng-class="{'weui_cell_hd':1,'must':item.ismust==1}"><label class="weui_label">{{item.title}}</label></div>
									<div class="weui_cell_bd weui_cell_primary">
										<input class="weui_input" type="number" ng-model="item.data" value="{{item.data || '0.00'}}" placeholder="输入{{item.title}}内容">
									</div>
									</div>

									<div class="weui_cell" ng-if="item.type == 3">
										<div ng-class="{'weui_cell_hd':1,'must':item.ismust==1}"><label class="weui_label">{{item.title}}</label></div>
										<div class="weui_cell_bd weui_cell_primary">
											<ul class="weui_uploader_files" ng-if="item.data">
												  <li class="weui_uploader_file" style="background-image:url({{tomedia(item.data)}})"></li>
											</ul>
											<div class="weui_uploader_input_wrp">
												 <input class="weui_uploader_input" ng-model="item.data" ng-click="up_file(item,'data','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
											</div>
										</div>
									</div>
									<div class="weui_cell" ng-if="item.type == 8">
											<div ng-class="{'weui_cell_hd':1,'must':item.ismust==1}"><label class="weui_label">{{item.title}}</label></div>
											<div class="weui_cell_bd weui_cell_primary">
												<input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
											</div>
									</div>
									<div ng-if="item.type == 9" class="weui_cell">
											<div ng-class="{'weui_cell_hd':1,'must':item.ismust==1}"><label class="weui_label">{{item.title}}</label></div>
											<div class="weui_cell_bd weui_cell_primary">
												<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
											</div>
									</div>
									<div ng-if="item.type == 4" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 4" class="weui_cells weui_cells_radio2" style="padding:0">
											<label class="weui_cell weui_check_label dashed" ng-repeat="(key,value) in item.value">
												<div class="weui_cell_bd weui_cell_primary">
													<span style="float:left;width:100%">{{value.title}}</span>
												</div>
												<div class="weui_cell_ft" href="javascript:;"  ng-click="item.data=value.title;">
													<input type="radio" class="weui_check" name="radio1">
													<span class="weui_icon_checked"></span>
												</div>
											</label>
									</div>	
									<div ng-if="item.type == 5" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 5" class="weui_cells weui_cells_checkbox" style="padding:0">
											<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem" ng-repeat="(key,value) in item.value">
												<input type="checkbox" ng-click="duoxuans(value.title,item,'data')" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" value="{{value.title}}" id="s11"> {{value.title}}
											</div>
									</div>
									<div ng-if="item.type == 6" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 6" class="weui_cells weui_cells_form" style="padding:0">
									<div class="weui_cell">
											<div class="weui_cell_bd weui_cell_primary">
												<textarea class="weui_textarea" ng-model="item.data" placeholder="请输入{{item.title}}" rows="2"></textarea>
												<div class="weui_textarea_counter"><span>0</span>/118</div>
											</div>
										</div>
									</div>
									<div ng-if="item.type == 7" class="weui_cells_title">{{item.title}}</div>
									<div ng-if="item.type == 7" class="weui_cells weui_cells_form" style="padding:0">
										<div class="weui_cell">
											<div class="fui-cell-label" style="width:33%">
												<select ng-model="item.data.province" class="form-control tpl-province">
												<option value="" selected="selected">省份</option>
												<option ng-repeat="(value,data) in pagedata.extradata.province.province" value="{{value}}" ng-selected="item.data.province==value">{{value}}</option>
												</select>
											</div>
											<div class="fui-cell-label" style="width:33%">
												<select ng-model="item.data.city" class="form-control tpl-city">
												<option value="" selected="selected">城市</option>
												<option ng-repeat="(value,data) in pagedata.extradata.province.province[item.data.province]" value="{{value}}" ng-selected="item.data.city==value">{{value}}</option>
												</select>
											</div>
											<div class="fui-cell-label" style="width:33%">
												<select ng-model="item.data.district" class="form-control tpl-district">
												<option value="" selected="selected">区县</option>
												<option ng-repeat="(value,data) in pagedata.extradata.province.province[item.data.province][item.data.city]" value="{{value}}" ng-selected="item.data.district==value">{{value}}</option>
												</select>
											</div>
											<div class="fui-cell-label" style="width:28%">
												<select ng-model="item.data.street" class="form-control tpl-district">
												<option value="" selected="selected">街道</option>
												<option ng-repeat="value in pagedata.extradata.province.province[item.data.province][item.data.city][item.data.district]" value="{{value}}" ng-selected="item.data.street==value">{{value}}</option>
												</select>
											</div>
										</div>
								   </div>		
			</div>
            <div class="fui-cell-group">
                <div class="fui-cell small ">
                    <div class="fui-cell-info">
                        <label class="checkbox-inline">
                            <input type="checkbox" class="fui fui-checkbox fui-checkbox-danger" ng-model="pagedata.item.agree" /> 我已经阅读并了解了<a id="btn-apply" ng-click="pagedata.show_content=true" style="color:#337ab7;">【{{pagedata.applyset.apply_title || '代理协议'}}】</a>。
                        </label>

                    </div>
                </div>

            </div>

            <div ng-show="pagedata.show_content" class="modal-bg pop-apply-hidden" >
                <div class="modal-content" style="top:10%;width:90%;left:5%">
                    <div class="closebtn" ng-click="pagedata.show_content=false" style="opacity:1;"><i class="icon icon-cuowu"></i></div>
                    <div class="news-body">
						<div class="title">{{pagedata.applyset.apply_title || '代理协议'}} / <small>Read &nbsp;Ggree</small></div>
                        <div class="text" ng-bind-html="trust(pagedata.applyset.apply_content)"></div>
                    </div>
					<div class="modal-footer">
                            <div ng-click="pagedata.show_content=false" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
                    </div>
                </div>
            </div>
        <div class='btn btn-danger block btn-submit' style="margin-top:2rem" ng-click="post(pagedata.item,'/apply/apply/')">申请成为{{pagedata.setting.agent_title||'代理'}}</div>
		</div>
	</div>
	</div>
</div>
